package com.pine.app.module.security.oauth.support;


import java.util.Map;
import java.util.Optional;
import java.util.Set;

/** oauth2请求的基础类
 * @author xiaoyuan
 * @create 2019/9/30 9:16
 **/
public interface HttpTokenRequest {

    default Optional<String> getParameter(String name) {
        return Optional.ofNullable(getParameters().get(name));
    }

    Map<String, String> getParameters();

    String getGrantType();

    ClientCredentials getClientCredentials();

    Set<String> getScope();

    default boolean enableRefresh(){
        return true;
    }
}
